package com.huabo.contract.mysql.mapper;

import com.huabo.contract.mysql.entity.TblProcessAnalusisUserMySql;
import com.huabo.contract.mysql.entity.TblProcessAnalysisMySql;


import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hbfk.entity.TblStaffUtil;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author huabo
 * @since 2021-10-26
 */
public interface TblProcessAnalysisMySqlMapper extends BaseMapper<TblProcessAnalysisMySql> {

	@SelectProvider(method="getByModuel",type=TblProcessAnalysisMySqlMapperSqlConfig.class)
	Integer getByModuel(String flownumber, TblStaffUtil staff) throws Exception;

	@Select("SELECT * FROM TBL_PROCESS_ANALYSIS WHERE PROCESSNAME = #{settingId}")
	List<TblProcessAnalysisMySql> getByFlowSetting(@Param("settingId")String settingid) throws Exception;

	@SelectProvider(method="findOndBytakdidstart",type=TblProcessAnalysisMySqlMapperSqlConfig.class)
	TblProcessAnalysisMySql findOndBytakdidstart(String usertaskid,String anid) throws Exception;

	@Select("select * from TBL_PROCESS_ANALUSIS_USER where FROMID = #{fromid} and ANALID = #{analid} AND ROWNUM = 1 ")
	TblProcessAnalusisUserMySql findOnd( @Param("analid")String analid, @Param("fromid")String fromid);

	@Select("select * from TBL_PROCESS_ANALYSIS where ANALID = #{analid} AND ROWNUM = 1 ")
	TblProcessAnalysisMySql findOndAnalysis( @Param("analid")String analid);

	@SelectProvider(method="findOndBytakdid",type=TblProcessAnalysisMySqlMapperSqlConfig.class)
	TblProcessAnalysisMySql findOndBytakdid(String usertaskid);

	@Select("SELECT * FROM TBL_PROCESS_ANALUSIS_USER WHERE ANALID = #{analid}")
	TblProcessAnalysisMySql findOndByAnalid(@Param("analid") String analid) throws Exception;

	@SelectProvider(method="findOndBytakdidAnId",type=TblProcessAnalysisMySqlMapperSqlConfig.class)
	TblProcessAnalysisMySql findOndBytakdidAnId(String usertaskid, String anid);


	@Select("SELECT * FROM TBL_PROCESS_ANALYSIS WHERE PROCESSNAME = #{settingid}")
    List<TblProcessAnalysisMySql> findSettingId(String settingid);

	@SelectProvider(method="listBySql",type=TblProcessAnalysisMySqlMapperSqlConfig.class)
    List<TblProcessAnalysisMySql> listBySql(String usertaskid, String anid);

	@SelectProvider(method="listBySqlUser",type=TblProcessAnalysisMySqlMapperSqlConfig.class)
	List<TblProcessAnalysisMySql> listBySqlUser(String flownumber, TblStaffUtil user);

	@SelectProvider(method="getByModuelStaff",type=TblProcessAnalysisMySqlMapperSqlConfig.class)
	List<TblProcessAnalysisMySql> getByModuelStaff(TblStaffUtil staff);

	@SelectProvider(method="getByStaff",type=TblProcessAnalysisMySqlMapperSqlConfig.class)
	boolean getByStaff(String flownumber, TblStaffUtil staff);

	@SelectProvider(method="getByModu",type=TblProcessAnalysisMySqlMapperSqlConfig.class)
	boolean getByModu(String flownumber, TblStaffUtil staff);
}
